import "DPI-C" function int inst_read(
	input int raddr
);

import "DPI-C" function void inst_write(
	input int waddr,
	input int wdata
);

module INST_SRAM(
    input             clk,
    input             reset,
    input             inst_sram_en,
    input             inst_sram_wen,
    input      [31:0] inst_sram_addr,
    input      [31:0] inst_sram_wdata,
    output reg [31:0] inst_sram_rdata
);
always @(posedge clk) begin
    if(inst_sram_en & ~reset) begin // 有读写请求时
        inst_sram_rdata <= inst_read(inst_sram_addr);
		if (inst_sram_wen) begin // 有写请求时
            inst_write(inst_sram_addr, inst_sram_wdata);
        end
    end
end


endmodule
